package com.moshang.blog.quartz;

import com.moshang.blog.quartz.service.QuartzService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author xww
 * Created on 2019/4/25.
 */
@Slf4j
@Component
public class JobSchedule implements CommandLineRunner {
    @Autowired
    private QuartzService taskService;
    @Override
    public void run(String... args) throws Exception {
        Thread.sleep(1000);
        log.info("---------线程启动---------");
        log.info("任务调度开始==============任务调度开始");
        taskService.timingTask();
        log.info("任务调度结束==============任务调度结束");
    }
}
